{{include file=Yaf\Application::app()->getConfig()->user->header_html}}
</head>
<body>
<div class="ok-body">
    <!--form表单-->
    <form class="layui-form ok-form">
        <div class="layui-form-item">
            <label class="layui-form-label">禁言原因</label>
            <div class="layui-input-block">
                <input type="text" name="forbid_excuse" placeholder="禁言原因" autocomplete="off" class="layui-input" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">禁言时长（天）</label>
            <div class="layui-input-block">
                <input type="text" name="forbid_num" placeholder="禁言时长" autocomplete="off" class="layui-input" lay-verify="required|number">
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="hidden" name="id" value="{{$id}}">
                <button class="layui-btn" lay-submit lay-filter="edit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<!--js逻辑-->
<script src="{{__STATIC__}}/lib/layui/layui.js"></script>
<script>
    layui.use(['form', "tree",'okUtils','okLayer'], function () {
        let form = layui.form,  okUtils = layui.okUtils,okLayer=layui.okLayer;
        okLoading.close();
        form.on('submit(edit)', function (data) {
            okUtils.ajax("/admin/User/member_forbidpublish", "post", data.field, true).done(function (response) {
                console.log(response);
                okLayer.greenTickMsg(response.msg, function () {
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                    window.location.reload();
                });
            }).fail(function (error) {
                console.log(error)
            });
            return false;
        });


    })
</script>
</body>
</html>
